package Day07;

import javax.swing.text.StyleContext;
import java.util.Scanner;
/*
键盘录入一个字符串，并统计字符串里面的大写字母和小写字母以及数字，并输入各自的次数
 */
public class Count {
    public static void main(String[] args) {
        //键盘录入一个字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串");
        String name = sc.next();
        //统计字符串的次数
        int smallCount = 0;
        int bigCount = 0;
        int numberCount = 0;

        for (int i = 0; i < name.length(); i++) {
            char c  = name.charAt(i);
            if(c >= 'a' && c <= 'z'){
                smallCount++;
            }else if(c >= 'A' && c <= 'Z'){
                bigCount++;
            }else if(c >= '0' && c <= '9'){
                numberCount++;
            }
        }
        System.out.println("一共有" + smallCount + "个小写字母");
        System.out.println("一共有" + bigCount + "个" + "大写字母");
        System.out.println("一共有" + numberCount + "个数字");

    }
}
